package com.happycat.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.happycat.Pagination;
import org.springframework.web.bind.annotation.RequestBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.happycat.ResponseModel;
import com.happycat.ResponseHeaderModel;
import com.happycat.mobile.model.HappyCatShop;
import com.happycat.mobile.service.HappyCatShopService;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liaoyong
 * @since 2020-08-01
 */
@RestController
@RequestMapping("/happyCatShop")
@Api(value = "系统商城", description = "系统商城接口")
public class HappyCatShopController {
    @Autowired
	private HappyCatShopService happyCatShopService;
	
	@ApiOperation(value = "系统商城详情")
    @RequestMapping(method = RequestMethod.POST, value = "/detail")
	public ResponseModel<HappyCatShop> detail(@RequestBody HappyCatShop happyCatShop){
		return happyCatShopService.selectOne(happyCatShop);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/page")
	@ApiOperation(value = "系统商城分页列表")
	public ResponseModel<Page<HappyCatShop>> Page(@RequestBody Pagination<HappyCatShop>page){
		return happyCatShopService.pageList(page);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/add")
	@ApiOperation(value = "系统商城新增")
	public ResponseHeaderModel add(@RequestBody HappyCatShop happyCatShop){
	
	   return happyCatShopService.add(happyCatShop);
	}
	@ApiOperation(value = "系统商城编辑")
	@RequestMapping(method = RequestMethod.POST, value = "/modify")
	public ResponseHeaderModel modify(@RequestBody HappyCatShop happyCatShop){
	
	   return happyCatShopService.modify(happyCatShop);
	}
	
}

